package com.atguigu.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @program: gulimall
 * @description: 用户注册
 * @author: liuxvru
 * @create: 2024-09-04 17:03
 **/
@Data
public class UserResgistVo {
    @NotEmpty(message = "用户名必须填写")
    @Length(min = 6,max = 18,message = "用户名长度必须在6-18之间")
    private String username;
    @NotEmpty(message = "密码必须填写")
    @Length(min = 6,max = 18,message = "密码必须在6-18之间")
    private String password;
    @NotEmpty(message = "手机号必须填写")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message = "手机号格式不正确")
    private String phone;
    @NotEmpty(message = "验证码必须填写")
    private String code;
}
